package com.dms.modules.product.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

/**
 * 商品分类实体类
 */
@Data
@Accessors(chain = true)
@TableName("product_category")
@ApiModel(value = "商品分类实体", description = "商品分类信息")
public class ProductCategory {

    @ApiModelProperty("分类ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("父分类ID")
    private Long parentId;

    @ApiModelProperty("分类名称")
    private String name;

    @ApiModelProperty("分类图标")
    private String icon;

    @ApiModelProperty("分类图片")
    private String image;

    @ApiModelProperty("层级")
    private Integer level;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("显示状态：0-隐藏 1-显示")
    private Integer showStatus;

    @ApiModelProperty("次元属性")
    private String dimension;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;

    @ApiModelProperty("是否删除：0-未删除 1-已删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("分类描述")
    private String description;

    @ApiModelProperty("是否可见：0-不可见，1-可见")
    private Integer visible;

    @TableField(exist = false)
    private List<ProductCategory> children = new ArrayList<>();
} 